package main

import "fmt"

// 自定义数据类型

type Code int

const (
	SuccessCode Code = 100
	ServerCode  Code = 200
	OtherCode   Code = 300
)

func (c Code) getMsg() string {
	switch c {
	case ServerCode:
		return "成功"
	case SuccessCode:
		return "还行"
	case OtherCode:
		return "失败"
	}
	return "结束"
}
func webserver(num Code) (code Code, info string) {
	return num, num.getMsg()
}
func main() {
	var n Code
	fmt.Println("请输入n的值")
	fmt.Scan(&n)
	fmt.Println(n.getMsg())
}
